﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class relatorio_espacovip : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string Permissao_RelatoriosGerais = "" + this.Session["Permissao_RelatoriosGerais"];
        if (Permissao_RelatoriosGerais != "1")
        {
            this.Response.Redirect("login.aspx");
        }
    }

    public string GetColor(int lowest, int highest, int current)
    {
        string style = "font-weight: bold; ";
        int buffer = highest - lowest;
        float interval = buffer / 3.0f;

        if (current <= interval)
        {
            style += " color: green;";
        }
        else if (current <= interval * 2)
        {
            style += " color: orange;";
        }
        else
        {
            style += " color: red;";
        }

        return style;
    }
}